package com.module.app.adapter.holder

import android.view.ViewGroup
import com.module.base.base.adapter.BaseViewHolder
import com.module.app.utils.GlideUtils
import com.module.app.R
import com.module.app.databinding.AppItemPayBinding
import com.module.third.bean.IThirdType

/**
 * @author bsnl_yanxuwen
 * @date 2020/11/4 18:56
 * Description :
 * 支付方式
 */
class PayHolder(parent: ViewGroup) : BaseViewHolder<Int, AppItemPayBinding>(parent) {
    override fun convert(bean: Int, position: Int) {
        when (bean) {
            IThirdType.IPayType.WX -> {
                com.module.app.utils.GlideUtils.load(mDatabind.ivIcon.context, itemView.findViewById(R.id.iv_icon), R.drawable.app_icon_wx)
                mDatabind.tvName.text = "微信支付"
            }
            IThirdType.IPayType.ALI -> {
                com.module.app.utils.GlideUtils.load(
                    mDatabind.ivIcon.context,
                    mDatabind.ivIcon,
                    R.drawable.app_icon_zhifubao
                )
                mDatabind.tvName.text = "支付宝支付"
            }
        }
    }
}